#ifndef REPORT_H
#define REPORT_H

#include "report_global.h"

#include <QObject>
#include <QPrinter>

class QPainter;
class QTextDocument;
class QPixmap;
class QStringList;
class ReportPrivate;

namespace YReport {


class REPORTSHARED_EXPORT Report : public QObject
{
    Q_OBJECT
public:
    explicit Report(QObject *parent = 0);
    ~Report();
    inline double millimeterToInches(double mm) { return mm * 0.039370147; }

    QPrinter::PageSize pageSize() const;
    void setPageSize(QPrinter::PageSize size);

    //page orientation
    QPrinter::Orientation orientation() const;
    void setOrientation(QPrinter::Orientation orientation);

    void setOutPutFilePath(const QString &path);

    qreal rightMargin() const;
    void setRightMargin(const qreal &rightMargin);

    qreal leftMargin() const;
    void setLeftMargin(const qreal &leftMargin);

    qreal topMargin() const;
    void setTopMargin(const qreal &topMargin);

    qreal bottomMargin() const;
    void setBottomMargin(const qreal &bottomMargin);

    qreal spacing() const;
    void setSpacing(const qreal &spacing);

    void setMargins(qreal margin);

    qreal headerSize() const;
    void setHeaderSize(const qreal &headerSize);

    qreal headerRule() const;
    void setHeaderRule(const double &headerRule);

    QString headerText() const;
    void setHeaderText(const QString &headerText);

    qreal footerSize() const;
    void setFooterSize(const qreal &footerSize);

    qreal footerRule() const;
    void setFooterRule(const qreal &footerRule);

    QString footerText() const;
    void setFooterText(const QString &footerText);

    QPrinter *printer() const;
    QWidget* parent() const;

protected:
    QRectF paperRect(QPaintDevice *device);
    QRectF contentRect(QPaintDevice *device);
    QRectF headerRect(QPaintDevice *device);
    QRectF footerRect(QPaintDevice *device);
protected:
    ReportPrivate *p;

private:
    Report(const Report&);
    Report &operator =(const Report&);
};


} //namespace YReport
#endif // REPORT_H
